/**
 * @description 选择排序算法
 */
Array.prototype.selectSort = function (){
    for (let i = 0; i < this.length-1; i++) {
        let indexMin = i;
        for (let j = i; j < this.length; j += 1){
            if (this[j] < this[indexMin]){
                indexMin = j;
            }
        }
        const tmp = this[i];
        this[i] = this[indexMin];
        this[indexMin] = tmp;
    }
};

//时间复杂度：O(n^2)